package com.example.demo.request;


import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;


public class TestConnectionRequest {


    @NotBlank(message = "数据库类型不能为空")
    private String dbType;


    @NotBlank(message = "主机地址不能为空")
    private String host;


    @NotNull(message = "端口号不能为空")
    @Min(value = 1, message = "端口号必须大于0")
    @Max(value = 65535, message = "端口号不能超过65535")
    private Integer port;

    //@Schema(description = "数据库名称", example = "test_db")
    @NotBlank(message = "数据库名称不能为空")
    private String databaseName;

    //@Schema(description = "用户名", example = "root")
    @NotBlank(message = "用户名不能为空")
    private String username;

    //@Schema(description = "密码", example = "password")
    @NotBlank(message = "密码不能为空")
    private String password;

    public String getDbType() {
        return dbType;
    }

    public void setDbType(String dbType) {
        this.dbType = dbType;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public String getDatabaseName() {
        return databaseName;
    }

    public void setDatabaseName(String databaseName) {
        this.databaseName = databaseName;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}